import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import Index from "../views/Index.vue";
import Login from '../views/Login.vue';
import Page404 from '../views/Page404.vue'
import Tag from '../views/Tag.vue'
import Article from "@/views/Article.vue";
import Content from '@/views/Content.vue'
import AddArticle from '@/views/AddArticle.vue'
import AddTag from '@/views/AddTag.vue'
import GameIndex from '@/games/views/Gomoku.vue'
import Gomoku from "@/games/views/Gomoku.vue";

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path: "/index",
    name: 'Index',
    component: Index
  },
  {
    path: '/',
    name: "Index",
    component: Index
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: "/tag",
    name: "Tag",
    component: Tag
  },
  {
    path: "/article",
    name: "Article",
    component: Article
  },
  {
    path: '/content',
    name: "Content",
    component: Content
  },
  {
    path: '/add_article',
    name: "AddArticle",
    component:  AddArticle
  },
  {
    path: '/add_tag',
    name: 'AddTag',
    component: AddTag
  },
  {
    path: '/gomoku',
    name: 'Gomoku',
    component: Gomoku
  },
  {
    path: "/snake",
    name: "Snake",
    component: () => import('@/games/views/Snake.vue')
  },
  {
    path: '/*',
    name: 'Page404',
    component: Page404
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
